package com.ruitu.health_2.ui.adapter;

import android.content.Context;
import android.widget.TextView;

import com.makeramen.roundedimageview.RoundedImageView;
import com.ruitu.arad.base.base_list.ListBaseAdapter;
import com.ruitu.arad.base.base_list.SuperViewHolder;
import com.ruitu.health_2.R;
import com.ruitu.router_module.bean.home.ReadPartie;
import com.ruitu.router_module.util.GlideUtil;

// 模块下的读书会列表adapter
public class ModelReadPartieListAdapter extends ListBaseAdapter<ReadPartie> {

    public ModelReadPartieListAdapter(Context context) {
        super(context);
    }

    @Override
    public int getLayoutId() {
        return R.layout.item_model_read_partie_list;
    }

    @Override
    public void onBindItemHolder(SuperViewHolder holder, int position) {
        RoundedImageView icon = holder.getView(R.id.icon);
        TextView tv_title = holder.getView(R.id.tv_title);
        TextView tv_name = holder.getView(R.id.tv_name);
        TextView tv_time = holder.getView(R.id.tv_time);
        TextView tv_subtitle = holder.getView(R.id.tv_subtitle);

        ReadPartie read = mDataList.get(position);
        tv_title.setText(read.getName());
        tv_name.setText(read.getBrokerageName());
        tv_time.setText(read.getAddress());
        tv_subtitle.setText(read.getContent());

        GlideUtil.loadImg(read.getLogo(), icon);
    }
}
